package com.smcaiot.jftorg.north.convert;

import com.smcaiot.jftorg.domain.user.User;
import com.smcaiot.jftorg.north.message.UserReviewResponse;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Author: cz
 * @Date: 2023/9/27
 * @Description:
 */
@Mapper
public interface UserReviewResponseConvert {

    UserReviewResponseConvert INSTANCE = Mappers.getMapper(UserReviewResponseConvert.class);

    @Mapping(target = "role", expression = "java(user.getRole().getCode())")
    UserReviewResponse from(User user);

}
